package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2019/1/29 22:35
 */
@AllArgsConstructor
@Getter
public enum RedisKey {

    UNIQUE_KEY("unique:%s", "Code唯一"),
    SUBMIT_KEY("submit:%s:%s", "提交幂等"),
    MQ_FAIL_KEY("mq_fail:%s", "执行失败队列"),
    MQ_KEY("mq:%s", "超长时间队列"),
    AUTH_KEY("USER:AUTH:%s:%s", "认证Token前缀"),
    TOKEN_KEY("USER:TOKEN:%s:%s", "认证用户前缀（关联认证token）"),
    QRCORD_KEY("USER:QRCODE:%s", "二维码登录"),
    MOBILE_KEY("GATE:MOBILE:%s", "短信验证码"),
    IMG_CODE_KEY("GATE:IMG:%s", "图片验证码"),
    NOTICE_KEY("notice:%s", "通知Token"),
    MONITOR_KEY("monitor:%s", "监控"),
    PAYED_KEY("payed:%s", "支付的"),
    BLACKLIST_KEY("blacklist:%s", "黑名单"),
    LOCKED_KEY("locked:%s", "登录失败锁定"),


    // 语音合成
    VOICE_BAIDU_ACCOUNT("voice:baidu", "百度语音合成"),

    JPUSH_KEY("jpush:%s", "极光推送帐号"),

    GRANT_CARD_KEY("grant:card:%s:%s", "会员卡支付授权码"),
    AP_KEY("alipay:%s", "支付宝商户授权"),
    WX_TOKEN_KEY("wechat:%s", "微信公众号Token"),
    WX_SHARE_KEY("wechat_share:%s", "微信分享key"),
    GRANT_WX_TOKEN_KEY("grant:wechat:%s", "微信开放平台小程序授权信息"),
    WX_ACCOUNT_KEY("wx_account:%s", "微信连锁相关帐号"),
    WX_SESSION_KEY("wx_session_key:%s", "微信小程序sessionKey"),
    WX_TEMPLATE_KEY("wx_template:%s", "微信公众号模板"),
    COUPON_KEY("coupon:%s", "券编号生成"),
    CONSTANT_KEY("constant:%s", "常量"),
    MARKET_KEY("market:%s", "团购Key"),
    USER_DATA_KEY("user:data:%s", "用户数据"),
    // 报表缓存
    DATA_TODAY_CHART("data:chart:today", "今日报表数据"),

    DATA_INVITATION_INCR("data:invitation:incr", "邀请码自增值"),
    COUPON_NEW_KEY("coupon:NEW:%s", "新用户购物津贴"),
    MOBILE_REG_SMS_KEY("mobile:reg:sms:%s", "手机号码注册短信验证码"),
    USER_PASSWORD_RESET_TOKEN_KEY("user:password:rest:token:%s", "用户重置密码token"),
    MOBILE_REST_SMS_KEY("mobile:reset:sms:%s", "手机号码重置密码短信验证码"),
    MOBILE_LOGIN_SMS_KEY("mobile:login:sms:%s", "手机号登录短信验证码"),
    MOBILE_BIND_SMS_KEY("mobile:bind:sms:%s", "手机号绑定短信验证码"),
    MOBILE_SMS_DAY_COUNT_KEY("mobile:sms:day:count:%s", "手机号每日接收短信条数"),


    WX_REG_KEY("wx:reg:%s", "微信注册验证码"),
    WX_AUTH_RESP_KEY("WX:auth:resp:%s", "微信认证返回消息信息"),
    SECKILL_ACTIVE_CACHE_PREFIX("seckill:active:%s", "活动缓存前缀"),
    SECKILL_ITEM_CACHE_PREFIX("seckill:item:", "活动商品缓存前缀"),
    SECKILL_USER_LIMIT_CACHE_PREFIX("seckill:userlimit:", "每人限购数量"),

    SOCKET_SERVER_PUSH("socket:server:push:%s", "推送消息socketServer"),
    SHARE_CODE_INFO("share:code:%s", "用户分享码分享码信息"),

    INVITE_REGION_KEY("invite_region:%s", "邀请码关联区域"),

    OAUTH_KEY("oauth:%s", "扫码登录Key"),
    BYTE_DANCE_KEY("byte_dance_key:%s", "字节跳动key"),
    BYTE_DANCE_TOKEN("byte_dance_token:%s", "字节跳动token"),
    BYTE_DANCE_SESSION("byte_dance_session:%s", "字节跳动session"),

    DICTIONARY_KEY("dictionary:%s", "数据字典"),
    ONLINE_DEVICE_KEY("online:%s", "在线设备"),

    ;
    private String key;
    private String desc;

    public String getKey(Object... keys) {
        return String.format(key, keys);
    }

}
